package cn.doitedu.dwetl.utls

import java.io.{DataOutputStream, FileOutputStream}
import java.nio.ByteBuffer

import org.apache.commons.lang3.RandomUtils
import org.roaringbitmap.RoaringBitmap

object RoaringBitMapDemo {
  def main(args: Array[String]): Unit = {

    val rb = new RoaringBitmap()
    /*for(i <- 0 until 100000000){
      rb.add(RandomUtils.nextInt(0,10000000))
    }

    val fout = new FileOutputStream("d:/rb.arr")
    val dout = new DataOutputStream(fout)
    rb.serialize(dout)

    dout.close()*/

    rb.add(100)
    rb.add(200)
    rb.add(123)

    println(rb.getCardinality)

    println(rb.contains(890898))


  }

}
